package com.guoliang.wechatpushing.service.impl;

import com.guoliang.wechatpushing.constant.Constant;
import com.guoliang.wechatpushing.service.DateService;
import com.guoliang.wechatpushing.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.xml.crypto.Data;
import java.text.ParseException;

/**
 * @author ：Leo
 * @date ：Created in 2022/10/18 15:30
 * @description：
 */
@Service
public class DateServiceImpl implements DateService {
    @Autowired
    Constant constant;
    @Override
    public String togetherDays() throws ParseException {
      return DateUtils.IntervalDays(DateUtils.getToday(),constant.togetherDay).toString()+"天";
    }
    @Override
    public String girlBirthdays() throws ParseException {
        return DateUtils.IntervalDays(constant.girlBirthDay,DateUtils.getToday()).toString()+"天";
    }
    @Override
    public String boyBirthdays() throws ParseException {
        return DateUtils.IntervalDays(constant.boyBirthDay,DateUtils.getToday()).toString()+"天";
    }
}
